from django.db import models

from apps.aiauth.models import Users
from apps.setup.models import Experts


class GuideRecord(models.Model):
    guiderecord_id = models.BigAutoField(primary_key=True, db_column='guiderecord_id')
    title = models.CharField(max_length=255, blank=True, null=True)
    sub_message = models.TextField(blank=True, null=True)
    timeslot_id = models.BigIntegerField(blank=True, null=True, db_column='timeslot_id')
    user = models.ForeignKey(Users, models.DO_NOTHING, blank=True, null=True, db_column='user_id')
    content = models.TextField(blank=True, null=True)
    content_html = models.TextField(blank=True, null=True)
    create_time = models.DateTimeField()
    update_time = models.DateTimeField(blank=True, null=True)
    publish_time = models.DateTimeField(blank=True, null=True)
    delete_time = models.DateTimeField(blank=True, null=True)
    status = models.IntegerField(blank=True, null=True)

    class Meta:
        db_table = 'guide_record'
        verbose_name_plural = '教师指导记录表'


# status，1为待审核，0为退回，2为通过，默认1
# is_dot，1为已评论，0未评论
class Resume(models.Model):
    resume_id = models.BigAutoField(primary_key=True, db_column='resume_id')
    experts = models.ForeignKey(Experts, models.DO_NOTHING, blank=True, null=True)
    user_id = models.ForeignKey(Users, models.DO_NOTHING, blank=True, null=True, db_column='user_id')
    # 设置唯一约束
    file_url = models.CharField(max_length=255, blank=True, null=True, unique=True)
    create_time = models.DateTimeField()
    status = models.IntegerField(blank=True, null=True)
    can_del = models.BooleanField(blank=True, null=True)
    is_dot = models.BooleanField(blank=True, null=True)
    file_name = models.CharField(max_length=255)

    class Meta:
        db_table = 'resume'
        verbose_name_plural = '简历表'
